<?php 
$data['page_selected'] = 'query';
$this->load->view('constants/header', $data);?>

<div id="site_content">
	<?php $this->load->view('constants/sidebar'); ?> 
    <div id="content">
        <!-- insert the page content here -->
	    <?php $this->load->view('query/menu'); ?>
        <br /><br /><br /><br />
  		<h3 align="center">Integrante</h3>        
        <table width="100%">
        	<tr>
             	<td align="center">
                    <form method="post" action="<?php echo base_url(); ?>query/search_user">
                        Buscar&nbsp;
                        <select name="type" id="type">
                            <option value="nombre">Nombre</option>
                            <option value="apellido">Apellido</option>
                            <option value="ci_integrante">C&eacute;dula</option>
                        </select>
                        &nbsp;
                        <input type="text" name="text" id="text">
                        <input type="image" alt="Submit" src="<?php echo base_url().IMG; ?>search_2.png" width="20px" height="20px" title="Buscar">
                    </form>
		        </td>
        	</tr>
        </table>
       	
        <table width="100%" align="center">
        	<thead>
                <th align="center">
                	C&eacute;dula
                </th>
                <th align="center">
                	Nombre
                </th>
                <th align="center">
                	Club perteneciente
                </th>
                <th align="center">
                	Buddy
                </th>
            </thead>
		<?php foreach($users as $u){ ?>
            <tr>
                <td align="center">
                    <?php echo $u['ci_integrante']; ?>
                </td>
                <td align="center">
                    <a href="<?php echo base_url() ?>query/get_user/<?php echo $u['id_integrante'] ?>">
                        <?php echo $u['nombre'].' '.$u['apellido']; ?>
                    </a>
                </td>
                <td align="center">
                    <?php echo $u['club_nombre']; ?>
                </td>
                <td align="center">
                	<a href="<?php echo base_url() ?>query/get_user/<?php echo $u['buddy']['id_integrante'] ?>">
                    	<?php echo $u['buddy']['nombre'].' '.$u['buddy']['apellido']; ?>
                    </a>
                </td>
            </tr>
        <?php } ?>
        	<tr>
            	<td colspan="4" align="center">
                	<?php  echo $this->pagination->create_links(); ?>
                </td>
            </tr>
        </table>
       
    </div>
</div>
<?php $this->load->view('constants/footer'); ?>